
jQuery.jPrintArea = function(el) {
	var iframe = document.createElement('IFRAME');
	var doc = null;
	
	$(iframe).attr('style','position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
	// $(iframe).attr('style','position:absolute;width:800px;height:800px;left:50px;top:50px;');
	
	document.body.appendChild(iframe);
	doc = iframe.contentWindow.document;
	
	var links = window.document.getElementsByTagName('link');
	for (var i = 0; i < links.length; i++) {
		var link = links[i];
		var url = link.href;
		// alert(url);
		if (link.rel.toLowerCase() == 'stylesheet') {
			doc.write('<link type="text/css" rel="stylesheet" href="' + url + '"></link>');
		}			
	}
	
	// alert($(el).attr("class"));
	// alert($(el).html());
		
	// doc.write('<html><body><div class="tec-ui-td tec-ui-th">' + $(el).html() + '</div></body></html>');
	doc.write('<div class="'+$(el).attr("class")+'" style="border:0px;">' + $(el).html() + '</div>');
	doc.close();
	
	iframe.contentWindow.focus();
	iframe.contentWindow.print();
	
	// alert('Printing...');
	
	// document.body.removeChild(iframe);
}
